<page-header [breadcrumb]="phNgContent" [title]="title">
    <ng-template #phNgContent class> </ng-template>
    <nz-card [nzBordered]="false">
      <form nz-form [formGroup]="form" (ngSubmit)="submit()" se-container="1" labelWidth="200">
        <se label="名称" error="名称不能为空或者空白字符" required>
          <input nz-input formControlName="name" placeholder="名称" />
        </se>

        <se label="名称" error="图标" required>
          <input nz-input formControlName="icon" placeholder="图标" />
        </se>
        <se label="默认网关类型" error="默认网关类型" required>
          <nz-select formControlName="gatewayType" placeholder="默认网关类型">
            <nz-option nzValue="Unknow" nzLabel="Unknow"></nz-option>
            <nz-option nzValue="Customize" nzLabel="Customize"></nz-option>
            <nz-option nzValue="Modbus" nzLabel="Modbus"></nz-option>
            <nz-option nzValue="Bacnet" nzLabel="Bacnet"></nz-option>
            <nz-option nzValue="OPC_UA" nzLabel="OPC_UA"></nz-option>
            <nz-option nzValue="CanOpen" nzLabel="CanOpen"></nz-option>
          </nz-select>
        </se>

        <se label="默认网关配置" error="默认网关配置" *ngIf="this.form.value.gatewayType==='Customize'">
          <nz-code-editor formControlName="gatewayConfigurationJson" [class.full-screen]="fullScreen" 
          style="width: 100%; height: 500px; padding-top: 1rem" class="editor" 
          [nzEditorOption]="{ theme: 'vs',language: 'json' }">
        </nz-code-editor>
        </se>
        <se label="默认网关配置名称" error="默认网关配置名称" *ngIf="this.form.value.gatewayType!=='Unknow'&&this.form.value.gatewayType!=='Customize'">
          <input nz-input formControlName="gatewayConfigurationName" placeholder="默认网关配置名称" />
        </se>
        <se label="默认设备类型" error="默认设备类型" required>
          <nz-select formControlName="defaultDeviceType" placeholder="默认设备类型">
            <nz-option nzValue="Device" nzLabel="Device"></nz-option>
            <nz-option nzValue="Gateway" nzLabel="Gateway"></nz-option>
          </nz-select>
        </se>
        <se label="默认超时" error="默认超时" required>
          <nz-input-number formControlName="defaultTimeout" [nzMin]="0"  [nzStep]="1"></nz-input-number>
        </se>
        <se label="默认认证方式" error="认证方式" required>
          <nz-select formControlName="defaultIdentityType" placeholder="默认认证方式">
            <nz-option nzValue="AccessToken" nzLabel="AccessToken"></nz-option>
            <nz-option nzValue="X509Certificate" nzLabel="X509Certificate"></nz-option>
          </nz-select>
        </se>
        <se>
          <input nz-input formControlName="id" type="hidden" />
          <button nz-button type="reset" (click)="close()">取消</button>
          <button nz-button nzType="primary" [disabled]="form.invalid" type="submit" [nzLoading]="submitting">保存</button>
        </se>
      </form>


 
    </nz-card>
  </page-header>
  